new Date().getFullYear()  //获取当前年
new Date().getMonth()     //获取当前月

// 打印当前时间
getNowDate()`{`
  let myDate = new Date;
  let year = myDate.getFullYear(); //获取当前年
  let mon = myDate.getMonth() + 1; //获取当前月
  let date = myDate.getDate(); //获取当前日
  var hours = myDate.getHours(); //获取当前小时
  var minutes = myDate.getMinutes(); //获取当前分钟
  var seconds = myDate.getSeconds(); //获取当前秒
  if(mon<=9){
      mon='0'+mon
  }
  if(date<=9){
      date='0'+date
  }
  if(hours<=9){
      hours='0'+hours
  }
  if(minutes<=9){
      minutes='0'+minutes
  }
  if(seconds<=9){
      seconds='0'+seconds
  }

  let now=year+'-'+mon+'-'+date+' '+hours+':'+minutes+':'+seconds
  console.log(now)
  return now
`}`